<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://eureka.yigolden.net/stringutils/sutaglib/1.0" prefix="su"%>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->

    <title>完善个人作休信息</title>

    <!-- Bootstrap core CSS -->
    <link href="<%=request.getContextPath() %>/static/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="<%=request.getContextPath() %>/static/css/signin.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="<%=request.getContextPath() %>/static/js/html5shiv.min.js"></script>
      <script src="<%=request.getContextPath() %>/static/js/respond.min.js"></script>
    <![endif]-->
    
    <script type="text/javascript">
    
	function submitForm(){
		
		var sleeptime = document.getElementById("sleeptime");
		var weekuptime = document.getElementById("weekuptime");
	
		if(sleeptime.value==""){
			alert("休息时间不能为空！");
			sleeptime.focus();
			return false;
		}
		
		if(weekuptime.value==""){
			alert("起床时间不能为空！");
			weekuptime.focus();
			return false;
		}
		return true;
	}

    </script>
    
    
  </head>

  <body>

  <div class="container">
	<h1 style="font-family:华文行楷;" >好室友<small>网</small> </h1>
    <div class="row">
		<div class="col-sm-3">
		</div>
		<div class="col-sm-6">
		<form class="form-horizontal" method="post" onsubmit="return submitForm();">
        <input type="hidden" name="action" value="userinfo" />    
        <c:if test="${userDetail ne null }">
        <div class="form-group">
    		<label for="inputPassword3" class="col-sm-4 control-label">真实姓名：</label>
    		<div class="col-sm-8">
      			<input type="text" class="form-control" id="realName" name="realName" value="${userDetail.realname }" placeholder="真实姓名……">
    		</div>
  		</div>  
  
  		<div class="form-group">
    		<label for="inputPassword3" class="col-sm-4 control-label">性别：</label>
    		<div class="col-sm-8">
    			<input type="text" class="form-control" id="gender" name="gender" value="${userDetail.gender }" placeholder="性别……">
    		
    		</div>
  		</div>  
  		 		
  		
  		
  		<div class="form-group">
    		<label for="inputPassword3" class="col-sm-4 control-label">休息时间：</label>
    		<div class="col-sm-8">
      			<input type="time" class="form-control" id="sleeptime" name="sleeptime" placeholder="休息时间……">
    		</div>
  		</div>  
  		
  		
  		 <div class="form-group">
    		<label for="inputPassword3" class="col-sm-4 control-label">起床时间：</label>
    		<div class="col-sm-8">
      			<input type="time" class="form-control" id="weekuptime" name="weekuptime" placeholder="起床时间……">
    		</div>
  		</div> 
  				
  		
  		
  		<div class="form-group">
    		<div class="col-sm-offset-4 col-sm-8">
    		  <div class="row">
      			<div class="col-sm-6">
     				 <button type="submit" class="btn btn-success">完善信息</button>
     		    </div>
      			<div class="col-sm-6">
      				<button type="reset" class="btn btn-warning">重新填写</button>
      			</div>	
      		   </div>
      		   <div class="row">
      		    <c:if test="${errorCode eq 0 }">
          			<div class="alert alert-warning" role="alert" id="alert-warning">添加成功！
          		 		<a href="<%=request.getContextPath() %>/Roommate/FindRoommate">前去发现新室友&raquo;&raquo;</a>
          			</div>
        		</c:if>

        		<c:if test="${errorCode eq 1 }">
          			<div class="alert alert-warning" role="alert" id="alert-warning">您已经添加过详细信息！不能重复添加！</div>
        		</c:if>  
        		</div>
    		</div>
  		</div>
        
        </c:if>
        
        
        <c:if test="${userDetail eq null }">
        	<div class="alert alert-warning" role="alert" id="alert-warning">您的个人详细信息尚不完整！
        	<a href="<%=request.getContextPath() %>/Account/ShowMyDetailInfo">前去完善个人信息&raquo;&raquo;</a>
        	</div>
        </c:if>
        <input type="hidden" name="referrer" value="${fn:escapeXml(referer) }" />
        
      </form>
      </div>
      <div class="col-sm-3"></div>
     </div>

    </div> <!-- /container -->

	<script src="<%=request.getContextPath() %>/static/js/jquery.min.js" ></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="<%=request.getContextPath() %>/static/js/ie10-viewport-bug-workaround.js"></script>
  </body>
</html>